#include<bits/stdc++.h>
using namespace std;
namespace my_std{
	#define ll long long
	#define bl bool
	ll my_pow(ll a,ll b,ll mod){
		ll res=1;
		if(!b) return 1;
		while(b){
			if(b&1) res=(res*a)%mod;
			a=(a*a)%mod;
			b>>=1;
		}
		return res;
	}
	ll qpow(ll a,ll b){
		ll res=1;
		if(!b) return 1;
		while(b){
			if(b&1) res*=a;
			a*=a;
			b>>=1;
		}
		return res;
	}
	#define db double
	#define pf printf
	#define pc putchar
	#define fr(i,x,y) for(register ll i=(x);i<=(y);i++)
	#define pfr(i,x,y) for(register ll i=(x);i>=(y);i--)
	#define go(u) for(ll i=head[u];i;i=e[i].nxt)
	#define enter pc('\n')
	#define space pc(' ')
	#define fir first
	#define sec second
	#define MP make_pair
	#define il inline
	#define inf 8e18
	#define random(x) rand()*rand()%(x)
	#define inv(a,mod) my_pow((a),(mod-2),(mod))
	il ll read(){
		ll sum=0,f=1;
		char ch=0;
		while(!isdigit(ch)){
			if(ch=='-') f=-1;
			ch=getchar();
		}
		while(isdigit(ch)){
			sum=sum*10+(ch^48);
			ch=getchar();
		}
		return sum*f;
	}
	il void write(ll x){
		if(x<0){
			x=-x;
			pc('-');
		}
		if(x>9) write(x/10);
		pc(x%10+'0');
	}
	il void writeln(ll x){
		write(x);
		enter;
	}
	il void writesp(ll x){
		write(x);
		space;
	}
}
using namespace my_std;
ll n,a[3][3]={{0,1,1},{2,2,0},{1,2,0}},dir[4][2]={{-1,0},{1,0},{0,-1},{0,1}};
char s[1000010],c[3]={'G','R','B'},ans[110][110],res[1000010];
il bl solve(ll N){
	ll x=0,y=0;
	fr(i,1,N){
		fr(j,1,N){
			if(ans[i][j]==s[1]&&max(abs(x-N/2),abs(y-N/2))>max(abs(i-N/2),abs(j-N/2))){
				x=i;
				y=j;
			}
		}
	}
	if(!x||!y) return 0;
	fr(i,2,n){
		ll xx=0,yy=0;
		fr(j,0,3){
			ll nx=x+dir[j][0],ny=y+dir[j][1];
			if(nx<1||nx>N||ny<1||ny>N) continue;
			if(ans[nx][ny]==s[i]&&max(abs(xx-N/2),abs(yy-N/2))>max(abs(nx-N/2),abs(ny-N/2))){
				xx=nx;
				yy=ny;
				if(!j) res[i]='U';
				else if(j==1) res[i]='D';
				else if(j==2) res[i]='L';
				else res[i]='R';
			}
		}
		if(!xx||!yy) return 0;
		x=xx;
		y=yy;
	}
	return 1;
}
il void getans(ll N){
	fr(i,1,N){
		fr(j,1,N){
			ll tmp=((i-1)/3)%3,x=(i-1)%3,y=(j-1)%3;
			ans[i][j]=c[(a[x][y]+tmp)%3];
		}
	}
	ll x=0,y=0;
	fr(i,1,N){
		fr(j,1,N){
			if(ans[i][j]==s[1]&&max(abs(x-N/2),abs(y-N/2))>max(abs(i-N/2),abs(j-N/2))){
				x=i;
				y=j;
			}
		}
	}
	ll stx=x,sty=y;
	fr(i,2,n){
		ll xx=0,yy=0;
		fr(j,0,3){
			ll nx=x+dir[j][0],ny=y+dir[j][1];
			if(nx<1||nx>N||ny<1||ny>N) continue;
			if(ans[nx][ny]==s[i]&&max(abs(xx-N/2),abs(yy-N/2))>max(abs(nx-N/2),abs(ny-N/2))){
				xx=nx;
				yy=ny;
				if(!j) res[i]='U';
				else if(j==1) res[i]='D';
				else if(j==2) res[i]='L';
				else res[i]='R';
			}
		}
		x=xx;
		y=yy;
	}
	pf("%lld %lld\n",N,N);
	fr(i,1,N){
		fr(j,1,N) pc(ans[i][j]);
		enter;
	}
	pf("%lld %lld\n",stx,sty);
	fr(i,2,n) pc(res[i]);
}
int main(){
	freopen("snake.in","r",stdin);
	freopen("snake.out","w",stdout);
	scanf("%s",s+1);
	n=strlen(s+1);
	fr(i,1,100){
		fr(j,1,100){
			ll tmp=((i-1)/3)%3,x=(i-1)%3,y=(j-1)%3;
			ans[i][j]=c[(a[x][y]+tmp)%3];
		}
	}
	ll l=1,r=100;
	while(l<r){
		ll mid=(l+r)>>1;
		if(solve(mid)) r=mid;
		else l=mid+1;
	}
	fr(i,max(1ll,l-10),l){
		if(solve(i)){
			l=i;
			break;
		}
	}
	getans(l);
}
